import type { PageResult } from '@/types/global'
import type { BannerItem, CategoryItem, GuessItem } from '@/types/home'
import { http } from '@/utils/http'

//首页-广告区域-小程序
export const getHomeBannerAPI = (type = 1) => {
  return http<BannerItem[]>({
    url: '/home/banner/list',
    method: 'GET',
    data: { type },
  })
}

//首页-前台分类-小程序
export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({
    url: '/home/category/mutli/list',
    method: 'GET',
  })
}

//首页-猜你喜欢-小程序
export const getHomeGuessPageAPI = (currPageNo = 1, pageSize = 6) => {
  return http<PageResult<GuessItem>>({
    url: '/home/goods/guessLike/list',
    method: 'GET',
    data: { currPageNo, pageSize },
  })
}
